import vue from 'vue'
// 用户的信息存储

export default new class {

  //存储用户信息
  Add(userInfo) {
    vue.$cookies.set('login-management', userInfo, 60 * 44)//存储50分钟
  }
  //获取用户信息
  getUserInfo() {
    return vue.$cookies.get('login-management')
  }
  //获取用户名
  getUserName() {
    var res = this.getUserInfo();
    return res.userName;
  }
  //获取组织id信息
  getOrganizationId() {
    var res = this.getUserInfo();
    return res.organizationId;
  }
  //获取用户id
  getUserId() {
    var res = this.getUserInfo();
    return res.id;
  }
  //获取用户id
  getUserHeardImgUrl() {
    var res = this.getUserInfo();
    return res.heardImgUrl;
  }
  //移除用户信息
  removeUser() {
    vue.$cookies.remove('login-management')
  }
}
